<template>
    <div>
      <el-card class="card"  v-loading="loading">
      </el-card>
    </div>
</template>

<script>
  export default {
    name: "crpLogin",
    data(){
      return{
        loading: true,
        redirect: undefined
      }
    },
    /*watch: {
      $route: {
        handler: function(route) {
          this.redirect = route.query && route.query.redirect;
        },
        immediate: true
      }
    },*/
    /*created() {
      this.handleLogin()
    },*/
    mounted() {
      this.handleLogin()
    },
    methods:{
      handleLogin(){
        const sid=this.$route.query.sid
        const ticket=this.$route.query.ticket
        this.$store.dispatch("CrpLogin", {sid:sid,ticeket:ticket}).then(() => {

          this.$router.push({ path: "/"}).catch(()=>{});
          window.location.href=window.location.origin+"/"
        }).catch(() => {
          this.$router.push({ path: "/login" })
        });
      }
    }
  }
</script>

<style scoped>
.card{
  margin: 10px 10px;
  min-height: 900px;
}

</style>
